package com.tfjybj.itoo.exam.provider.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tfjybj.itoo.exam.entity.AssessmentAdviceEntity;
import com.tfjybj.itoo.exam.model.AssessmentAdviceModel;
import com.tfjybj.itoo.exam.model.EvaluationRecordModel;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * TrAssessmentAdviceDao接口
 * trAssessmentAdvice表
 *
 * @author 杨江涛
 * @version 2.0.0
 * @since 2.0.0 2018-12-18 18:19:48
 */
@Repository("trAssessmentAdviceDao")
public interface AssessmentAdviceDao extends BaseMapper<AssessmentAdviceEntity> {

   /**
    * 根据问题id和课程id题干id查询该题干下的学生作答记录
    * @param paperId  问卷id
    * @param questionMainId  题干id
    * @param courseId  课程id
    * @param schoolYear 学年学期
    * @return 建议列表
    * @author 杨晓慧
    * @Date 2018年12月27日08:39:44
    */
   List<AssessmentAdviceModel> queryAdviceDetailByPaperId(@Param("paperId") String paperId, @Param("questionMainId") String questionMainId, @Param("courseId") String courseId, @Param("schoolYear") String schoolYear);


   /**
    * 根据问题id和课程id查询简答题题干
    * @param paperId  问卷id
    * @param courseId  课程id
    * @param schoolYear 学年学期
    * @return 简答题题干
    * @author 杨晓慧
    * @Date 2018年12月27日08:39:44
    */
   List<AssessmentAdviceModel> queryQuestionMainByPaperId(@Param("paperId") String paperId, @Param("courseId") String courseId, @Param("schoolYear") String schoolYear);

   /**
    * 实时更新评教建议到数据库和redis
    * @param model
    * @return boolean
    * @author 魏恩君
    * @since 2.0.0 2019/3/21
    */
   Boolean updateAdviceRecord(@Param("model") EvaluationRecordModel model);

   Boolean updateAdviceRecordById(@Param("model") EvaluationRecordModel model);

   /**
    * 查询简答题答题记录
    * @param paperId  问卷id
    * @param courseId  课程id
    * @param schoolYear 学年学期
    * @param studentId 学生id
    * @return
    * @author 魏恩君
    * @Date 2019年3月22日12:35:16
    */
   List<AssessmentAdviceModel> queryShortRecord(@Param("paperId") String paperId, @Param("courseId") String courseId, @Param("schoolYear") String schoolYear, @Param("studentId") String studentId);

   Boolean insertAdviceByBatch(@Param("paperRecords") List<AssessmentAdviceEntity> assessmentAdviceEntityList);

}
